  {% extends "adibilisadminBundle::layout.html.twig" %}
   
  {% block title %}
    {{ activite.name }} - Détails d'une activité - {{ parent() }}
  {% endblock %}
   
  {% block adibilisadmin_body %}
   </br>

  {% if app.session.hasFlash('info') %}
          <div class="alert alert-success">
              {{ app.session.flash('info') }}
          </div>
  {% endif %}


    <h2>{{ activite.name }} </h2>

    <hr />




<div class="row">

  <center> <div class="span6" >

</br>


{% if activite.image %}
      <a href="#myModal"   data-toggle="modal"><img src="/adibilis/web/uploads/img/{{ activite.image.id }}.{{ activite.image.url }} "  class="img-rounded" style=" width:350px" /></a>

     <!-- Modal -->
    <div id="myModal" style="width=700px" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">{{ activite.name }}</h3>
      </div>
      <div class="modal-body">
        <p><center><img src="/adibilis/web/uploads/img/{{ activite.image.id }}.{{ activite.image.url }} "  height=100% /></center></p>
      </div>

    </div>
{% else %}
        
    <a href="#myModal"   data-toggle="modal"><img src="/adibilis/web/img/defaultactivity.png"  class="img-rounded" style=" width:350px" /></a>
     
     <!-- Modal -->
    <div id="myModal" style="width=700px" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">{{ activite.name }}</h3>
      </div>
      <div class="modal-body">
        <p><center><img src="/adibilis/web/img/defaultactivity.png"  height=100% /></center></p>
      </div>

    </div>
{% endif %}



</div>


    <div class="span6"></br><div id="map_canvas" style="width:100%; height:250px"></div><br/></div> </center>
</div>




<div class="row-fluid">
 <div class="span6">

  <h4>{{ 'activite.voir.accessibility'|trans }} </h4>
      <div class="well">





    {% if app.request.locale == 'fr' %}

      {% for criteria in activite.criterias %}
          <img style="width: 30px;" src="/adibilis/web/uploads/img/criterias/{{ criteria.image.id }}.{{ criteria.image.url }}" alt="{{ criteria.name }}" /> &nbsp; &nbsp;
          {{ criteria.name }}
          <hr />
      {% endfor %}

    {% endif %}



    {% if app.request.locale == 'en' %}

      {% for criteria in activite.criterias %}
          <img style="width: 30px;" src="/adibilis/web/uploads/img/criterias/{{ criteria.image.id }}.{{ criteria.image.url }}" alt="{{ criteria.nameen }}" /> &nbsp; &nbsp;
          {{ criteria.nameen }}
          <hr />
      {% endfor %}

    {% endif %}



    {% if app.request.locale == 'de' %}

      {% for criteria in activite.criterias %}
          <img style="width: 30px;" src="/adibilis/web/uploads/img/criterias/{{ criteria.image.id }}.{{ criteria.image.url }}" alt="{{ criteria.namede }}" /> &nbsp; &nbsp;
          {{ criteria.namede }}
          <hr />
      {% endfor %}

    {% endif %}



        </div>
 </div>

<div class="span6">

<h4>{{ 'activite.voir.informations'|trans }} :</h4>
     <div class="well">


    {% if app.request.locale == 'fr' %}

    {% for category in activite.categories %}
   {{ category.name }} -
    {% endfor %}
    {% endif %}



    {% if app.request.locale == 'en' %}

    {% for category in activite.categories %}
   {{ category.nameen }} -
    {% endfor %}
    {% endif %}


    {% if app.request.locale == 'de' %}

    {% for category in activite.categories %}
   {{ category.namede }} -
    {% endfor %}
    {% endif %}


    <hr />

     {{ activite.address }}
     </br>
     {{ activite.locality.npa }}
     {{ activite.locality.locality }}
     <hr />
     {{ 'activite.voir.phone'|trans }} : {{ activite.telephone }}
     <hr />
     E-mail : <a href="mailto:{{ activite.email }}" >{{ activite.email }} </a>

    </div>

</div>

</div>




    
  <h4>{{ 'activite.voir.description'|trans }}</h4>

    <div class="well">
      {% if app.request.locale == 'fr' %}
        {{ activite.description | raw }}
      {% endif %}

      {% if app.request.locale == 'en' %}
        {{ activite.descriptionen | raw }}
      {% endif %}

      {% if app.request.locale == 'de' %}
        {{ activite.descriptionde | raw }}
      {% endif %}


    </div>
   

  <hr />
    

   <div class="well comment-box">
        <div class="comment-header">
            <div class="row">
                <div class="span1">
                     <span><i class="icon-comments"></i></span>
                </div>
                <div class="span5">
                    <h4>{{nbComments}} {{ 'comment.names'|trans }}</h4>
                </div>
            </div>     
        </div>                            
        <hr>
        <ul class="media-list">


          {% for comment in comments %}

            <li class="media">
                <a class="pull-left" href="#">
                    <img class="media-object img-polaroid" src="/adibilis/web/img/round/avatar.png">
                </a>
                <div class="media-body">
                    <h6 class="media-heading">{{ comment.user.username }} <br> <small> {{ comment.date| localizeddate('full', 'none', 'en') }} - {{ comment.date| localizeddate('none', 'short', 'en') }} </small></h6>
                    <p> «  {{ comment.content }} »</p>


                          {% if is_granted('ROLE_ADMIN') %}


                               <a href="{{ path('admin_deletecomment', { 'idActivite': activite.id, 'idComment': comment.id }) }}" class="btn">
                            <i class="icon-trash"></i>
                            Supprimer
                          </a>


                          {% endif %}
                    <!-- Nested media object -->
                  
                </div>
            </li>
              {% endfor %}

              <hr>

              <div class="comment-header">
            <div class="row">
                <div class="span1">
                     <span><i class="icon-comment"></i></span>
                </div>
                <div class="span5">
                    <h4> {{ 'comment.leave'|trans }} <br> <small>{{ 'comment.give_opinion'|trans }}</small></h4>
                </div>
            </div>     
        </div>
        </br></br>
        


           {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_USER')  %}


          
            <form method="post" {{ form_enctype(form) }}>
              {{ form_widget(form) }}
              </br>
              <input type="submit" value="{{ 'comment.submit'|trans }}" class="btn btn-primary" />
            </form>
          

        {% else %}

        {{ 'comment.connect'|trans }}  <a href="{{ path('fos_user_security_login') }}"> {{ 'comment.connect2'|trans }} </a> {{ 'comment.connect3'|trans }}
        </br> </br>

              {% endif %}              


        </ul>

        </div>               
        <hr>


   

    <p>
      <a href="{{ path('adibilisadmin_acceuil') }}" class="btn">
        <i class="icon-chevron-left"></i>
        {{ 'layout.buttons.back'|trans }}
      </a>

      {% if is_granted('ROLE_ADMIN') %}

      <a href="{{ path('adibilisadmin_modifier', {'id': activite.id}) }}" class="btn">
        <i class="icon-edit"></i>
        Modifier l'activité
      </a>
      <a href="{{ path('adibilisadmin_supprimer', {'id': activite.id}) }}" class="btn">
        <i class="icon-trash"></i>
        Supprimer l'activité
      </a>

      {% endif %}

    </p>


  <script>
  var latitud = {{ activite.latitude }};
  var longitud = {{ activite.longitude }};
  var type = "detail";
  </script>


<script>
   initialize();
</script>


   
  {% endblock %}